package com.wsdcd.zlg.sb.controller;

import com.wsdcd.zlg.sb.model.service.StatisticsService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@AllArgsConstructor
@Controller
@RequestMapping("/statistics")
public class StatisticsController {
	private final StatisticsService statisticsService;

	@RequestMapping("show")
	public String userDelete(HttpServletRequest request, Model model) {
		//初始化数据
		//改变订单数量为0
		statisticsService.setOrderNumberZero();
		String data = statisticsService.getWeekData();
		model.addAttribute("Data",data);
		return "statistics/statistics";
	}
}
